package com.artifact.mit.mypoint.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.artifact.mit.mypoint.model.TransactionHistory;
import com.artifact.mit.mypoint.R;

public class TransactionHistoryAdapter extends ArrayAdapter<TransactionHistory> {
	
	public TransactionHistoryAdapter(Context context) {
		super(context, 0);
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(
					R.layout.transaction_history_row_item, null);
		}
		
		TextView date = (TextView) convertView.findViewById(R.id.textView13);
		TextView desc = (TextView) convertView.findViewById(R.id.textView14);
		TextView ref = (TextView) convertView.findViewById(R.id.textView15);
		TextView withdraw = (TextView) convertView.findViewById(R.id.textView16);
		TextView deposits = (TextView) convertView.findViewById(R.id.textView17);
		TextView balance = (TextView) convertView.findViewById(R.id.textView18);
		
		date.setText(getItem(position).date);
		desc.setText(getItem(position).desc);
		ref.setText(getItem(position).ref);
		withdraw.setText(getItem(position).withdraw);
		deposits.setText(getItem(position).deposits);
		balance.setText(getItem(position).balance);
		
		return convertView;
	}

}
